import { Routes, Route, Navigate } from 'react-router-dom'
import React, {lazy,Suspense } from 'react';
import { Spin } from 'antd';
import 'animate.css';
const LoginAndRegister = lazy(() => import('./pages/LoginAndRegister'))
const OrgMenu = lazy(() => import('./pages/OrgMenu'))
const AdminMenu = lazy(() => import('./pages/AdminMenu'))
const UserMenu = lazy(() => import('./pages/UserMenu'))

function App() {
  return (
    <div className="App">
       <Suspense fallback={<Spin size='large' />}>
      <Routes>
        <Route path='loginAndRegister/*' element={<LoginAndRegister/>} />
        <Route path='orgMenu/*' element={<OrgMenu/>} />
        <Route path='userMenu/*' element={<UserMenu/>} />
        <Route path='adminMenu/*' element={<AdminMenu/>} />
        <Route path={'*'} element={<Navigate to='/userMenu' />} />

      </Routes>
      </Suspense>
    </div>
  );
}

export default App;
